/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jlibrarian.web;

import javax.servlet.http.HttpSession;

/**
 *
 * @author dandelion8
 */
public class MessagesHandler
{
    HttpSession session;
    
    public MessagesHandler(HttpSession session) {
        this.session = session;
    }
    
    public void setMessage(String type, String text)
    {
        String message =  this.session.getAttribute("messages").toString() + "<div class=\"message " + type + "\">" + text + "</div>";
        this.session.setAttribute("messages", message);
    }
}
